home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / XmosP.h.z / XmosP.h
C/C++ Source or Header  |  2002-10-15  |  5KB  |  196 lines

  1. /* 
  2.  *  @OSF_COPYRIGHT@
  3.  *  COPYRIGHT NOTICE
  4.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  6.  *  the full copyright text.
  7. */ 
  8. /* 
  9.  * HISTORY
  10. */ 
  11. /* $TOG: XmosP.h /main/15 1997/03/25 14:45:55 dbl $ */
  12. /* (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  13. /* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  14. #ifndef _XmosP_h
  15. #define _XmosP_h
  16.  
  17. /* Some SVR4 systems don't have bzero. */
  18. /* 2.1.10 change */
  19. #include <Xm/Xmfuncs.h>        /* for bzero et al */
  20.  
  21. /*
  22.  * Fix for 8975 - using LOGNAME instead of USER on SYSV and SVR4 
  23. */
  24.  
  25. #ifndef USER_VAR
  26. #if defined(SYSV) || defined(SVR4)
  27. #define USER_VAR "LOGNAME"
  28. #else
  29. #define USER_VAR "USER"
  30. #endif
  31. #endif
  32.  
  33. /*
  34.  * Fix for 5222 - if NO_MEMMOVE is defined, some systems will still
  35.  *                require stdlib.h.
  36.  */
  37. #ifdef NO_MEMMOVE
  38. #ifdef bcopy
  39. #undef bcopy
  40. #endif
  41. #ifdef memmove
  42. #undef memmove
  43. #endif
  44. #define memmove( p1, p2, p3 )   bcopy( p2, p1, p3 )
  45. #endif
  46.  
  47. #ifndef X_NOT_STDC_ENV
  48. #include <stdlib.h> /* Needed for MB_CUR_MAX, mbtowc, mbstowcs and mblen */
  49. #endif
  50.  
  51. /* On Sun systems, mblen is broken. It doesn't return 0 when the
  52.    string is empty. Here's a patch. NOTE: On Sun systems, mblen
  53.    is a macro wrapper around mbtowc. Hence the implementation below. */
  54. #if defined(sun)
  55. #undef  mblen
  56. #define mblen(ptr, size) \
  57.   ((ptr && *(ptr) == '\0') ? 0 : mbtowc((wchar_t *)0, (ptr), (size)))
  58. #endif
  59.  
  60. #include <limits.h>        /* for MB_LEN_MAX et al */
  61.  
  62. #ifndef INT_MAX
  63. #define INT_MAX 2147483647
  64. #endif
  65. #ifndef LONG_MAX
  66. #define LONG_MAX 2147483647
  67. #endif
  68. #ifdef BOGUS_MB_MAX  /* some systems don't properly set MB_[CUR|LEN]_MAX */
  69. #undef MB_LEN_MAX
  70. #define MB_LEN_MAX 1 /* temp fix for ultrix */
  71. #undef MB_CUR_MAX
  72. #define MB_CUR_MAX 1 /* temp fix for ultrix */
  73. #endif /* BOGUS_MB_MAX */
  74.  
  75. /**********************************************************************/
  76. /* here we duplicate Xtos.h, since we can't include this private file */
  77.  
  78. #ifdef INCLUDE_ALLOCA_H
  79. #include <alloca.h>
  80. #endif
  81.  
  82. #ifdef CRAY
  83. #define WORD64
  84. #endif
  85.  
  86. /* stolen from server/include/os.h */
  87. #ifndef NO_ALLOCA
  88. /*
  89.  * os-dependent definition of local allocation and deallocation
  90.  * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE
  91.  * LOCAL then you add that in here.
  92.  */
  93. #if defined(__HIGHC__)
  94.  
  95. #if HCVERSION < 21003
  96. #define ALLOCATE_LOCAL(size)    alloca(size)
  97. pragma on(alloca);
  98. #else /* HCVERSION >= 21003 */
  99. #define    ALLOCATE_LOCAL(size)    _Alloca(size)
  100. #endif /* HCVERSION < 21003 */
  101.  
  102. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  103.  
  104. #endif /* defined(__HIGHC__) */
  105.  
  106.  
  107. #ifdef __GNUC__
  108.  
  109. #ifndef alloca /* gnu itself might have done that already */
  110. #define alloca __builtin_alloca
  111. #endif
  112.  
  113. #define ALLOCATE_LOCAL(size) alloca(size)
  114. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  115. #else /* ! __GNUC__ */
  116. /*
  117.  * warning: mips alloca is unsuitable, do not use.
  118.  */
  119. #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar)
  120. /*
  121.  * Some System V boxes extract alloca.o from libPW.a; if you
  122.  * decide that you don't want to use alloca, you might want to fix it here.
  123.  */
  124. char *alloca();
  125. #define ALLOCATE_LOCAL(size) alloca(size)
  126. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  127. #endif /* who does alloca */
  128. #endif /* __GNUC__ */
  129.  
  130. #endif /* NO_ALLOCA */
  131.  
  132. #ifndef ALLOCATE_LOCAL
  133. #define ALLOCATE_LOCAL(size)    XtMalloc(size)
  134. #define DEALLOCATE_LOCAL(ptr)    XtFree(ptr)
  135. #endif /* ALLOCATE_LOCAL */
  136.  
  137. /* End of Xtos.h */
  138. /*****************/
  139.  
  140. #include <Xm/XmP.h>
  141.  
  142. /* For padding structures in Mrm we need to know how big pointers are. */
  143. #if !defined(CRAY) && !defined(__alpha)
  144. #define MrmShortPtr
  145. #endif
  146.  
  147. #ifdef __cplusplus
  148. extern "C" {
  149. #endif
  150.  
  151.  
  152. #define MATCH_CHAR 'P'  /* referenced in InitPath strings and in the files 
  153.              that uses it (ImageCache.c and Mrmhier.c) */
  154.  
  155. /* OS-dependent file info for VirtKeys */
  156.  
  157. #define XMBINDDIR "XMBINDDIR"
  158. #ifndef XMBINDDIR_FALLBACK
  159. #define XMBINDDIR_FALLBACK "/usr/lib/Xm/bindings"
  160. #endif
  161. #define XMBINDFILE "xmbind.alias"
  162. #define MOTIFBIND ".motifbind"
  163.  
  164. typedef enum {
  165.   XmOS_METHOD_NULL,
  166.   XmOS_METHOD_DEFAULTED,
  167.   XmOS_METHOD_REPLACED
  168. } XmOSMethodStatus;
  169.  
  170. typedef XmDirection (*XmCharDirectionProc)(XtPointer   /* char */,
  171.                        XmTextType  /* type */,
  172.                        XmStringTag /* locale */);
  173.  
  174. typedef Status  (*XmInitialDirectionProc)(XtPointer      /* chars */,
  175.                       XmTextType     /* type */,
  176.                       XmStringTag    /* locale */,
  177.                       unsigned int * /* num_bytes */,
  178.                       XmDirection *  /* direction */);
  179.  
  180.  
  181. /********    Private Function Declarations    ********/
  182.  
  183. extern XmOSMethodStatus XmOSGetMethod(Widget w,
  184.                       String method_name,
  185.                       XtPointer * method,
  186.                       XtPointer * os_data);
  187.  
  188. /********    End Private Function Declarations    ********/
  189.  
  190. #ifdef __cplusplus
  191. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  192. #endif
  193.  
  194. #endif /* _XmosP_h */
  195. /* DON'T ADD ANYTHING AFTER THIS #endif */
  196.